
import java.util.Comparator;
import java.util.PriorityQueue;

class MyCompare implements Comparator<Integer> {
    public int compare(Integer a,Integer b){
        return b.compareTo(a);
    }
}
public class project {
    public static void main(String[] args) {
        int i=0;
        Integer j = new Integer(0);
        System.out.println(i==j);
        System.out.println(j.equals(i));
    }





    public int lastStoneWeight(int[] stones) {
        PriorityQueue<Integer> queue=new PriorityQueue<>(new MyCompare());
        for(int i=0;i<stones.length;i++){
            queue.add(stones[i]);
        }
        while(queue.size()>1){
            int newVal=queue.poll()-queue.poll();
            queue.add(newVal);
        }
        return queue.poll();
    }
}
